package com.barry.pattern.adapter;

import com.barry.pattern.BaseMode;

public class Adapter extends BaseMode implements Runnable{

	public Adapter(String modeName) {
		super(modeName);
	}

	@Override
	public void run() {
		adapter();
	}

	/**
	 * 适配器模式
	 */
	static void adapter() {
		Hand hand = new Hand();
		hand.setToolAdapter(new Gun());
		hand.cut();
		hand.setToolAdapter(new Knife());
		hand.cut();
	}

}
